package com.ronglian.register_mini_program.common;

import com.ronglian.register_mini_program.result.ResultBody;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice(basePackages = "com.ronglian.register_mini_program.controller")
public class GlobalExceptionGHandler {

    @ResponseBody
    @ExceptionHandler(value = Exception.class)
    public ResultBody exceptionHandler(Exception ex) {
        return new ResultBody("500", ex.getMessage());
    }

}
